package com.huawang.mdesign.model.service.util.reqif;

import com.huawang.mdesign.model.service.util.reqif.ref.DatatypeDefinitionEnumerationRef;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import lombok.Getter;
import lombok.Setter;

/**
 * Definition of an enumeration attribute.
 *
 * @author xdl
 * @since 2023-04-04
 */
@Getter
@Setter
@XStreamAlias(ReqIFConstants.ATTRIBUTE_DEFINITION_ENUMERATION)
public class AttributeDefinitionEnumeration extends AbstractAttributeDefinition {

    /**
     * If set to true, this means that the user of a requirements authoring tool can pick one or more than one of the values in
     * the set of specified values as an enumeration attribute value.
     * <p>
     * If set to false, this means that the user of a requirements authoring tool can pick exactly one of the values in the set
     * of specified values as an enumeration attribute value.
     */
    @XStreamAlias(ReqIFConstants.MULTI_VALUED)
    @XStreamAsAttribute
    private Boolean multiValued;

    /**
     * Reference to the data type
     */
    @XStreamOmitField
    private DatatypeDefinitionEnumeration type;

    @XStreamAlias(ReqIFConstants.TYPE)
    private DatatypeDefinitionEnumerationRef typeRef;

    /**
     * Linkage of the owned default value that is used if no attribute value is supplied by the user of the requirements
     * authoring tool.
     */
    @XStreamAlias(ReqIFConstants.DEFAULT_VALUE)
    private AttributeValueEnumeration defaultValue;
}
